@extends('admin.layout.layout', ['row' => @$page])

@section('contain')

    <div class="portlet">
        <div class="portlet-title">
            <div class="caption">
                <x-portlet-breadcrumb :page="$page"></x-portlet-breadcrumb>
            </div>
            <div class="actions"></div>
        </div>

        <div class="filter-wrapper">
            <form action="/{{ request()->path() }}/" class="form-inline filter-form">
                <div class="input-group mb-3 custom-control-inline">
                    <input type="text" class="form-control s-input" name="value" value="{{ request()->input('value') }}" placeholder="{{ ts('VTS1') }}">
                </div>
                <div class="input-group mb-3 custom-control-inline">
                    <select name="status" class="form-control">
                        <option value="">{{ ts('select').' '.ts('status') }}</option>
                        <option value="0" {{ request()->input('status') !== null && request()->input('status') == 0 ? 'selected' : '' }}>{{ ts('DS1') }}</option>
                        <option value="1" {{ request()->input('status') == 1 ? 'selected' : '' }}>{{ ts('DS2') }}</option>
                        <option value="2" {{ request()->input('status') == 2 ? 'selected' : '' }}>{{ ts('DS3') }}</option>
                    </select>
                </div>
                <x-flatpickr-date-range label="{{ ts('CZrq') }}"></x-flatpickr-date-range>

                <div class="mb-3">
                    <button class="btn btn-primary">{{ ts('SEARCH') }}</button>
                    <a href="/{{ request()->path() }}/" class="btn btn-warning">{{ ts('RESET') }}</a>
                </div>

            </form>
        </div>
        <div>
            <style>
                .table-responsive    th{
                    word-break:keep-all;
                }
            </style>
            <div class="">
                <table class="table text-nowrap bt-table d-none">
                    <thead>
                    <tr class="order_column text-center">
                        <th data-column="id" style="width: 80px">{{ ts('SEQUENCE') }}</th>
                        <th data-column="film_type_id" style="width: 150px">{{ ts('FILMTYPE') }}</th>
                        <th data-column="roll_number" style="width: 150px">{{ ts('rollnumber') }}</th>
                        <th data-column="length" style="width: 150px">{{ ts('DHCD') }}</th>
                        <th>{{ ts('FQFsdmd') }}</th>
                        <th>{{ ts('jsfsdmd') }}</th>
                        <th>{{ ts('fqr') }}</th>
                        <th>{{ ts('fqrq') }}</th>
                        <th>{{ ts('status') }}</th>
                        <th class="fixed-td" style="width:270px">
                            {{ ts('OPERATIONS') }}
                        </th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($data as $k => $v)
                        <tr class="item-list">
                            <td>
                                <div class="truncated-3">{{ @$data->firstItem()+$k }}</div>
                            </td>
                            <td>
                                <div class="truncated-3">{{ ts('film_type_master.'.$v->film_type_id) }}</div>
                            </td>
                            <td>
                                <div class="truncated-3">{{ @$v->roll_number }}</div>
                            </td>
                            <td>
                                <div class="truncated-3">{{ @$v->length }} cm</div>
                            </td>
                            <td>
                                @if($v->yuser_type == 3)
                                    {{ @$v->ysdmc }} / {{ @$v->ygmsmc }}
                                @else
                                    {{ @$v->ygmsmc }}
                                @endif
                                {{--{{ @$v->ygmsmc }}--}}
                            </td>
                            <td>

                                @if($v->xuser_type == 3)
                                    {{ @$v->xsdmc }} / {{ @$v->xgmsmc }}
                                @else
                                    {{ @$v->xgmsmc }}
                                @endif
                                {{--{{ @$v->xgmsmc }}--}}
                            </td>
                            <td>{{ @$v->czy }}</td>
                            <td>
                                <div class="truncated-3">{{ fdate2(@$v->created_at) }}</div>
                            </td>
                            <td>{{ ts('STA'.@$v->approved) }}</td>
                            <td  class="fixed-td text-center" style="width:270px">
                                @if (!empty($menus) && in_array('look', $menus))
                                <a class="btn btn-success btn-sm" href='/{{ request()->path() }}/{{ $v->id }}'>{{ ts('VIEW') }}</a>
                                @endif
                                @if (!empty($menus) && in_array('dhjl', $menus))
                                <a class="btn btn-primary btn-sm" href='/{{ request()->path() }}/{{ $v->id }}/records'>{{ ts('DHJL') }}</a>
                                @endif
                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            </div>
            <div class="row my-3">
                {{--<div class="col-auto">
                    <label style="cursor: pointer"><input type="checkbox" class="icheck_all" data-ele=".roll_icheck"><span class="ml-2">{{ ts('SELECTALL') }}</span></label>
                    <span class="btn btn-primary ml-3" onclick="deleteAlliCheck('.roll_icheck', '/admin/rolls/deletes')">{{ ts('delete') }}</span>
                </div>--}}
                <div class="col">
                    {{ $data->appends(request()->input())->links() }}
                </div>
            </div>
        </div>


    </div>


@endsection

@section('script')
    <script>
        $(document).ready(function () {
            $('.table.bt-table').bootstrapTable({
                fixedColumns: true,
                fixedRightNumber: 1,
            }).removeClass('d-none')
        })
    </script>
@endsection